from unit_test.stock_information.fund_detail_test import FundDetailTest
from unit_test.stock_information.stock_detail_test import StockDetailTest
from unit_test.stock_information.stocks_information_test import StocksInformationTest
from unit_test.stock_visual.stock_mpf_plot_test import StockPlotTest
from unit_test.stock_visual.email_send_test import EmailSendTest
from unit_test.entity.stock_test import StockTest
import unittest

import warnings
warnings.filterwarnings("ignore")  #忽略异常，不在控制台打印异常

# fund_detail_test = FundDetailTest()
# stock_detail_test = StockDetailTest()
# stocks_information_test = StocksInformationTest()

'''对多个测试类进行测试'''
#参考 https://blog.csdn.net/qq_43370607/article/details/124410107

# 创建类加载对象
loader = unittest.TestLoader()
# 分别加载多个测试类
suit1 = loader.loadTestsFromTestCase(FundDetailTest)
suit2 = loader.loadTestsFromTestCase(StockDetailTest)
suit3 = loader.loadTestsFromTestCase(StocksInformationTest)
suit4 = loader.loadTestsFromTestCase(StockPlotTest)
suit5 = loader.loadTestsFromTestCase(EmailSendTest)
suit6 = loader.loadTestsFromTestCase(StockTest)

# 放在套件里
suits = unittest.TestSuite([suit1, suit2, suit3,suit4, suit5, suit6])

run = unittest.TextTestRunner()
run.run(suits)

